Include approved submissions in apps list#48
Conversation
Query approved app submissions and merge them with official apps for the public apps response. Adds import for appSubmissions, fetches approved submissions ordered by submittedAt, maps each submission into the existing App shape (sets slug to `ugc-{id}`, isOfficial=false, fills frequency from clickCount, fallback category to 'Other', empty tags, and normalizes timestamps), and combines that list with the official apps (renamed to officialApps). Keeps existing featured/today logic unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates how user-submitted apps (UGC) are surfaced: they should appear immediately on a user’s profile regardless of approval status, while only approved submissions appear on the homepage/apps directory endpoint. It also updates documentation to reflect the new flow.
Changes:
- Profile API now joins submitted apps without filtering to approved status and attempts to add submission status to the query result.
- Apps API now merges official apps with approved submissions by transforming submissions into the same shape as official apps.
- Documentation updated to describe the new profile vs homepage visibility rules for submissions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
claude.md |
Updates documentation of profile/homepage behavior for submitted apps. |
api/profile/[slug].ts |
Removes approved-only join restriction for profile apps and selects submission status. |
api/apps.ts |
Fetches approved submissions, transforms them into “App-like” objects, and merges them into the apps list response. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| submissionLogoUrl: appSubmissions.logoUrl, | ||
| submissionDescription: appSubmissions.description, | ||
| submissionCategory: appSubmissions.category, | ||
| submissionStatus: appSubmissions.status, |
There was a problem hiding this comment.
submissionStatus is selected from appSubmissions, but it is never surfaced in the returned apps payload (the submitted-app branch in apps_data does not include it). This means the API response still doesn't expose submission approval status as described in the PR; include the status field in the submitted app objects (and consider naming it consistently, e.g. status or submissionStatus).
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| // Get all approved submissions | ||
| const approvedSubmissions = await db | ||
| .select() | ||
| .from(appSubmissions) | ||
| .where(eq(appSubmissions.status, 'approved')) | ||
| .orderBy(desc(appSubmissions.submittedAt)); |
There was a problem hiding this comment.
/api/apps now returns approved UGC submissions mixed in with official apps. This endpoint is also used as the source of truth for pinning/autocomplete flows that assume IDs exist in the apps table (e.g. profile “Add to profile and homepage” and /api/profile/add-app validates against apps). As-is, a user can select/pin a submission ID and hit 404/lose the pin in management views. Consider either (1) keeping /api/apps as official-only and adding a separate endpoint (or query param) for “homepage apps incl. submissions”, or (2) returning a distinct identifier/type for submissions and updating consumers to filter to isOfficial for pin/autocomplete.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@ghostleek I've opened a new pull request, #52, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot can you resolve merge conflicts on api/apps.ts? |
|
@ghostleek I've opened a new pull request, #53, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@ghostleek I've opened a new pull request, #54, to work on those changes. Once the pull request is ready, I'll request review from you. |
This pull request updates how user-submitted apps are handled and displayed in the application, improving both backend logic and user experience. The main change is that user-submitted apps now appear immediately on the user's profile, regardless of approval status, but only appear on the main homepage after being approved. The changes also refactor how apps are combined and surfaced in the API responses.
App display and submission logic updates:
Documentation and user flow updates: